var set = new Set([1, 2, 3, 4, 2, 8, 4]); 
var arr=[...set]
console.log(arr);